package com.chenxiao.datasource.mainsource.controller;

import com.chenxiao.datasource.mainsource.service.UserService;
import com.chenxiao.datasource.mainsource.utils.AjaxResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author: CX
 * @Date: Created in  2023/12/06 22:21
 * @version: v1.0
 * @Description: TODO
 **/
@RestController
public class UserController {
    @Resource
    private UserService userService;
    @GetMapping("/user/{id}")
    public AjaxResult getUserById(@PathVariable Long id){
        return new AjaxResult("200", userService.selectByPrimaryKey(id));
    }
}
